package cn.com.ylpw.web.common.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import cn.com.ylpw.search.service.ISearchParamsService;
import cn.com.ylpw.web.common.service.ICommonService;
import cn.com.ylpw.web.util.AbstractService;

/**
 * 基础信息加载
 * 
 * @author July july_sky@foxmail.com
 * @date 2015年5月26日下午3:09:48
 * @Copyright ©2003-2015 北京春秋永乐文化传播有限公司. All Rights Reserved.
 * @version 1.0
 */
@Service("commonService")
public class CommonServiceImpl extends AbstractService implements ICommonService {
	private final static String NAME_SPACE = "cn.com.ylpw.web.common.Common";
	@Autowired
	@Qualifier("searchParamsService")
	private ISearchParamsService searchParamsService;
	@Cacheable(key="#root.targetClass.name+'.'+#root.methodName",value="ssmcache",cacheManager="ssmCacheManager")
	@Override
	public List<Map<String, Object>> findTopCityList(Map<String, Object> params)
			throws Exception {
		//return super.superDao.getMyBatisFactory().findObjectList(NAME_SPACE, "findTopCityList", params);
		return searchParamsService.getFcity(params);
	}
	//@Cacheable(key="#root.targetClass.name+'.'+#root.methodName+#params.get('loginName')",value="ssmcache",cacheManager="ssmCacheManager")
	@Override
	public Map<String, Object> getCustmoerByLogin(Map<String, Object> params)
			throws Exception {
		return super.superDao.getMyBatisFactory().getObject(NAME_SPACE, "getCustmoerByLogin", params);
	}
	@Cacheable(key="#root.targetClass.name+'.'+#root.methodName",value="ssmcache",cacheManager="ssmCacheManager")
	@Override
	public List<Map<String, Object>> findAreaCityList(Map<String, Object> params)
			throws Exception {
		return super.superDao.getMyBatisFactory().findObjectList(NAME_SPACE, "findAreaCityList", params);
	}
}
